package com.googlecode.dgwt.client.dojo.data.model;

import com.googlecode.dgwt.client.dijit.View;
import com.googlecode.dgwt.client.dojo.data.base.ModeledStore;
import com.googlecode.dgwt.client.dojo.data.base.Store;
import com.googlecode.dgwt.client.dojo.data.listener.AttachListener;
import com.googlecode.dgwt.client.dojo.exception.AttachException;

/**
 * @author wellsantos@wellsantos.com
 * @since 0.01
 */
public interface StoreModel<Item,Column extends StoreColumn<Item,?>> extends AttachListener<Store<Item>> {

    public <C extends Column> ColumnSet<C> getColumns();
    
    public void onAttach(Store<Item> store) throws AttachException;
    public void onDetach(Store<Item> store);
    
    public boolean isAttachedTo(Store<?> store);
    public Iterable<ModeledStore<Item>> getAttachedStores();
    
    public void onRegisterParent(View parentView, boolean registered);
    
    public Item createItem();

}
